package org.jcubic.mvc.context;

import org.jcubic.mvc.servlet.AppMVCContext;
import org.jcubic.v.core.ConfigHelper;

import javax.servlet.ServletContext;

/**
 * Web 启动加载类
 */
public class ContextLoader {

    public static final String ROOT_JCUBIC_CONFIG_PATH= "JCubicConf";

    public void initWebApplicationContext(ServletContext servletContext) {

        String configPath = servletContext.getInitParameter(ROOT_JCUBIC_CONFIG_PATH);
        ConfigHelper.init(configPath);

        AppMVCContext instance = AppMVCContext.getInstance();
        instance.onStartup(servletContext);

    }

    public void closeWebApplicationContext(ServletContext servletContext) {

    }
}
